Traditional streaming services are based on a real-time transport protocol and a real time control protocol. This type of streaming service requires special streaming servers, and encounters the hinder of traversing the firewall. However, HTTP (Hypertext Transfer Protocol, Hypertext Transfer Protocol) transmission is free from such problems. Due to wide application of the web, plenty of basic facilities such as web server and content distribution network (CDN) can support HTTP transmission. The application of HTTP-based media streaming is gaining increasingly wide application.
In the traditional live media streaming service, the client uses specially defined time “now” (now) to indicate the start time for the server to stream the media data. The server keeps sending the content that starts from the specified time to the client, and the client needs to simply receive and stream the media stream sent by the server, without caring whether the local time is synchronous to the server time.
In the live streaming service of HTTP streaming (HTTP Streaming), the server responds passively by sending specified content fragments to the client as requested by the client. To implement live streaming, the client continues requesting the media fragments from the server, and directly or indirectly uses time to indicate requested media fragments. Such requests are interpreted by the server in terms of the local time at the server. Besides, in the HTTP streaming, “now” defined in traditional streaming service is not applicable because “now” is uncertain time and needs to be interpreted by “intelligence” of the server. The simple file server used by the HTTP streaming has no “intelligence”. Therefore, the client needs to set up a time synchronization relationship with the server, and to apply the server time rather than the local time in the request. Otherwise, the server cannot accurately interpret the request from the client, and cannot implement the live streaming service.
To solve the foregoing synchronization problem, a method in the prior art applies a dynamically updated media data index. That is, a media fragment index is maintained on the server to record the time interval or the sequence number, and the storage location of each media fragment. With generation of the media fragment, the server updates the index in real time. The client can obtain the information about the latest media fragment from the index. In the solution, the time synchronization is an implicit and continuous process. The essence of the client requesting the index file is a process of setting up synchronization. The media fragment index is updated once, the client can obtain a media fragment.
In the process of implementing embodiments, the inventor finds that: In the live streaming, the media fragment is generated in real time. To obtain the latest media fragment, the client needs to first request the media fragment index from the server and obtain the information about the latest media fragment, then the client can request the media fragment from the server. Frequent update and reading of the media fragment index increase the load of the server. Moreover, the load of the server increases with increase of users. Secondly, the request and the transmission of the media fragment index consume the bandwidth and increase delay of media stream. Therefore, the solution in the prior art does not well solve the issue of synchronization between the client and the server.